package com.by.controller;

import com.by.biz.AdminBiz;
import com.by.entity.Admin;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
public class AdminController {
    @Autowired
    private AdminBiz adminBiz;
    @RequestMapping("/query")
    public String queryAdmin(Model model){
        List<Admin> admins = adminBiz.queryAdminList();
        model.addAttribute("admina",admins);
        return "admina";
    }

    /*@RequestMapping("/login")
    public String login(Admin admin,Model model){
        Admin admins = adminBiz.adminLogin(admin);
        model.addAttribute("admins",admins);
        if(admins!=null){
            return "admins";
        }else {
            return "输入有误";
        }
    }*/
}
